package simple04;

import simple04.builder.Builder;
import simple04.fruit.Apple;
import simple04.fruit.Banana;
import simple04.fruit.Orange;
//节假日
public class HoilDayBuilder implements Builder {
    private FruitMeal fruitMeal = new FruitMeal();
    @Override
    public void buildApple(int price) {
        Apple apple = new Apple();
        apple.setPrice(price);
        apple.fruit();
        fruitMeal.setApple(apple);
    }

    @Override
    public void buildBanana(int price) {
        Banana banana = new Banana();
        banana.setPrice(price);
        banana.fruit();
        fruitMeal.setBanana(banana);
    }

    @Override
    public void buildOrange(int price) {
        Orange orange = new Orange();
        orange.setPrice(price);
        orange.fruit();
        fruitMeal.setOrange(orange);
    }

    @Override
    public FruitMeal getFruitMeal() {
        fruitMeal.setDiscount(15);
        fruitMeal.init();
        return fruitMeal;
    }
}
